package edu.pw.p2pclient.networking.messages;

import java.io.Serializable;

import edu.pw.p2pclient.data.DownloadNode;
import edu.pw.p2pclient.data.Resource;

/*
 * Personized message to one client with specific resource requests.
 */
public class ResourcePartRequestMessage extends Message implements Serializable {

	private static final long serialVersionUID = -7020456463139220878L;

	private Resource mRequestedResource;
	private int mPart;
	private int mPort;

	public ResourcePartRequestMessage(DownloadNode resource, int part, int port) {
		super(MsgType.RESOURCE_PART_REQUEST);
		mRequestedResource = new Resource(resource);
		mPart = part;
		mPort = port;
	}

	public Resource getResource() {
		return mRequestedResource;
	}

	public int getPart() {
		return mPart;
	}

	public int getPort() {
		return mPort;
	}
}
